package com.shuoyue.ycgk.ui.papergroups.realpaper;

import com.shuoyue.ycgk.base.baseadapter.IndexFragmentStateAdapter;
import com.shuoyue.ycgk.entity.Type;
import com.shuoyue.ycgk.ui.papergroups.BasePaperGroupActivity;

import java.util.ArrayList;
import java.util.List;

public class RealPaperActivity extends BasePaperGroupActivity {

    @Override
    protected void initView() {
        super.initView();
        pageTitle.setText("历年真题");
    }

    @Override
    public void setTabType(List<Type> type) {
        fragmentMainItems = new ArrayList<>();
        for (Type topType : type) {
            fragmentMainItems.add(FragmentRealPaper.getInstance(topType,false, 1));
        }
        indexFragmentAdapter = new IndexFragmentStateAdapter(getSupportFragmentManager(), fragmentMainItems);
        tabLayout.setupWithViewPager(viewPager);
        viewPager.setOffscreenPageLimit(1);
        viewPager.setAdapter(indexFragmentAdapter);
        refreshlayout.setEnableRefresh(false);
    }
}
